<template>
  <draggable
    :list="tabledata"
    :options="{ forceFallback: true }"
    style="background: #ffffff;"
    @update="changePlace"
  >
    <div v-for="item in tabledata" :key="item.id" class="firstLevel">
      <div class="leverFirst">
        {{ item.title }}
        <div class="leverFirst_name">
          <i
            v-if="item.children"
            :class="flagicon ? 'el-icon-arrow-down' : 'el-icon-arrow-right'"
            style="margin-right:5px;cursor: pointer"
            @click="hiddenchildren"
          />{{ item.title }}
        </div>
        <el-checkbox
          v-model="item.isBind"
          class="leverFirst_check"
          @change="changecheck(item, $event)"
        />
        <el-input
          v-model="item.orderId"
          @input="value => changeSelect(value, item)"
        />
        <template v-if="item.children">
          <DragTableList :table-data="item.children" />
        </template>
        <!-- <a-select
            v-model="item.orderId"
            show-search
            option-filter-prop="children"
            style="width: 30%;padding-top:5px;"
            @change="value => changeSelect(value, item)"
          >
            <template v-for="item1 in tableLen">
              <a-select-option
                v-if="selectArr1.includes(item1)"
                :key="item1"
                :value="item1"
                disabled
              >
                {{ item1 }}
              </a-select-option>
              <a-select-option v-else :key="item1" :value="item1">
                {{ item1 }}
              </a-select-option>
            </template>
          </a-select> -->
      </div>
    </div>
  </draggable>
</template>
<script>
import draggable from 'vuedraggable';
export default {
  // name: "DragTableList",
  components: { draggable },
  props: {
    tableData: {
      type: Object,
      default: () => ({})
    },
    tableList: {
      type: Object,
      default: () => ({})
    }
  },
  computed: {
    tabledata() {
      return this.tabledata.table || [];
    }
  },
  methods: {
    // changePlace(e) {
    //   this.$emit(changePlace, e);
    // }
  }
};
</script>
